package com.gameShare.controller.misc

import com.gameShare.controller.base.BaseController
import com.gameShare.entity.vo.CaptchaVo
import com.gameShare.entity.vo.ResponseVo
import com.gameShare.service.misc.CaptchaService
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("/captcha")
class CaptchaController(private val captchaService: CaptchaService) : BaseController() {

    /**
     * 获取验证码
     *
     * @return 验证码值对象
     */
    @RequestMapping("/getCaptcha")
    fun getCaptcha(): ResponseVo<CaptchaVo> {
        return getSuccessResponseVO(captchaService.generateCaptcha())
    }
}